<?php
require 'autoload.php';

use Qiniu\Auth;
use Qiniu\Storage\UploadManager;

// 用于签名的公钥和私钥
$accessKey = '-JLvYg-7Pa1SGcLzw1qyrzSt5dqpp-7Xr5ZB_XI3';
$secretKey = 'p0srnaa2qyYM7fS5kKp_OCUTYwiUMb-Jr8C9VXxY';

// 初始化签权对象
$auth = new Auth($accessKey, $secretKey);
$bucket = 'show';

//生成上传token
$token = $auth->uploadToken($bucket);


// 构建 UploadManager 对象
$uploadMgr = new UploadManager();

$key = "hello";
$filePath = "123456.jpg";
$a = $uploadMgr->putFile($token, $key, $filePath);
print_r($a);